<?php
session_start();
include "../../include/dbFunctions.php";
$cid = $_POST['cid'];
$vid = $_POST['vid'];
$eid = $_SESSION['eid'];
$query1 = "DELETE FROM trainer
            WHERE event_id = $eid
            AND volunteer_id = $vid";
$result1 = executeQuery($query1);
if ($result1!=0) {
    //send email
    //if !mail --> rollback
    $_SESSION['mes']="The record has been updated successfully";
    header('Location: ' . $_SERVER['HTTP_REFERER']);
} else {
    $_SESSION['mes']="Error! Please try again";
    header('Location: ' . $_SERVER['HTTP_REFERER']);
}
?>
